home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
LLR001.422
< prev
next >
Wrap
Text File
|
1993-03-07
|
13KB
|
443 lines
[LLR001.MOD] 256 Color Mod, with MCI codes!
Leisure Larry #1 @18860
Wed Mar 03 19:01:50 1993
7[1Mess Stat7] 1Reply Requested, Thanks
7────────────────────────────────────────────────────────────────────────────
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name : LLR001.MOD Mod Author: Leisure Larry #1 │
│ Difficulty: Mostly block read Freedom/Dark/Warp/Fed/Vital @8852 │
│ WWIV Version: 4.22 WWIV @8869, Ice @8861, Link @18860│
│ Files Effected: VARS.H, COM.C, BBSUTL.C (Optional BBS.C, MSGBASE.C) │
│ Description: 256 Color Mod, + MCI Codes! Date: March 2, 1993 │
└────────────────────────────────────────────────────────────────────────────┘
This Mod was formerly the SSMOD04a.MOD, but hasn't been updated for quite
sometime! (SSMOD04A.MOD, by Hoser of Sweven Swede's BBS) Therefore, his
original mod/idea deserves all the credit, I've just enhanced/updated it for
for v4.22.
Have you ever wished that WWIV could handle more than 8 colors while
writting a message(single line editor)? Just think, while in a message
hitting Ctrl-\ + (a 2 digit code) would then make available up to 256
different Foreground to background color configurations (including Blinking
and Intensified!).
With the two digit code going like this.
(Ctrl-\)+xx
First x :
Background color.
0-7 are the standard Background colors.
8,9,A-F are those same standard colors BUT with the Foreground
set to blinking.
Second x :
Foreground color.
0-7 are the standard (blah) colors for the foreground.
8,9,A-F are those same colors with Intensity turned on!
* Note: Can also be used in other places.. (ie..Random Quotes, Message
titles).. Also, if you know the equilvalent control keys, you can
incorporate these 256 color codes into your source code. For the Heart
shape charcters, you generally use Cntl-P Cntl-C (in Turbo C++). To
obtain the character that is equilvalent to the heart shape, but for the
256 color codes... you would use Cntl-P Alt-19 then the 2 digit color
code of your choice. A couple of examples, within the source code where
you would generally use your Cntl-P Cntl-C's (heart shapes) would be in
the...
- npr's, outstr's, sprintf's...
just substitute them with your own color codes of Cntl-P Alt-19 + 2 digits.
Another place... you can now use them in your external string files...
The ESM will allow you to input the same Cntl-P Cntl-C heart shapes, so
you can use your Cntl-P Alt-19 + 2 digit color codes as well. It works
for me.
Sounds swell don't it?
Then install this MOD.
This has been updated for WWIV v4.22 source and may work fine with v4.21a.
▄▄▄▄▄▄▄▄
▌BONUS!▐ An MCI Ctrl-P mod to show the current users
▀▀▀▀▀▀▀▀ Control-P N for Current User's NAME
Control-P R for Current User's REAL NAME
Control-P S for Current User's STREET
Control-P B for Current User's CITY
Control-P E for Current User's STATE
Control-P F for Current User's ZIPCODE
Control-P # for Current User's VOICEPHONE
Control-P P for Current User's DATAPHONE
Control-P @ for Current User's PASSWORD
Control-P T for Current User's TIME
Control-P D for Current User's DATE
To incorporate into anything that uses inli();
You will inadvertantly install it into your BBS.
(so sorry if you dont want it)
256 color codes work with MCI's, just as well. :)
If you have a Random Quote Mod... You'll love these
MCI's!
Legend
= existing code
- delete existing code
+ Add code
──╢▌Step 1▐╟───────────────────────────────────────────────────────────────
Back up your source!
──╢▌Step 2▐╟───────────────────────────────────────────────────────────────
Load up VARS.H
Make the following addition for "ctrlzc".....
+ __EXTRN__ unsigned char actsl, andwith, checksum, ctrlzc; /* Add ctrlzc */
Save VARS.H
──╢▌Step 3▐╟───────────────────────────────────────────────────────────────
Load up COM.C and find...
void outchr(char c)
Then make the appropriate changes to the void so that the following
changes are there!
- if (change_color) { Delete this portion
- change_color = 0; from your source, and
- if ((c >= '0') && (c <= '7')) replace with the below.
- ansic(c - '0'); Just cut and paste!
- return;
- }
+ if (change_color==1) {
+ change_color = 0;
+ if ((c >= '0') && (c <= '7') || (c=='N') || (c=='R') ||
+ (c=='S') || (c=='B') || (c=='E') || (c=='F') || (c=='P') ||
+ (c=='D') || (c=='T') || (c=='#') || (c=='@')) {
+
+ if ((c>='0') && (c<='7')) ansic(c-'0');
+ if (c=='N') outstr(thisuser.name);
+ if (c=='R') outstr(thisuser.realname);
+ if (c=='S') outstr(thisuser.street);
+ if (c=='B') outstr(thisuser.city);
+ if (c=='E') outstr(thisuser.state);
+ if (c=='F') outstr(thisuser.zipcode);
+ if (c=='P') outstr(thisuser.dataphone);
+ if (c=='D') outstr(date());
+ if (c=='T') outstr(times());
+ if (c=='#') outstr(thisuser.phone);
+ if (c=='@') outstr(thisuser.pw);
+ }
+ return;
+ }
+ if ((change_color==2) || (change_color==4)) {
+ if (change_color==2) {
+ change_color=4;
+ if ((c>='0') && (c<='9')) { c=(c-48); }
+ else if ((c>='A') && (c<='F')) { c=(c-55); }
+ ctrlzc=(c*16);
+ } else if (change_color==4) {
+ change_color=0;
+ if ((c>='0') && (c<='9')) { c=(c-48); }
+ else if ((c>='A') && (c<='F')) { c=(c-55); }
+ ctrlzc=(ctrlzc+c);
+ if (okansi()) setc(ctrlzc);
+ }
+ return;
+ }
= if (c == 3) { /* existing code, leave alone */
= change_color = 1;
= return;
= }
+ if (c == 19) { /* add these 4 lines of code */
+ change_color = 2;
+ return;
+ }
Save COM.C !
──╢▌Step 4▐╟───────────────────────────────────────────────────────────────
Next Load up BBSUTL.C
Find the ...
void inli(char *s, char *rollover, int maxlen, int crend)
First add to the unsigned char list so that it says...
+ unsigned char ch,ch2; /* add ch2 */
further down, just exchange each of these case statements, and add the
extra case 28: Cntl-\ this is what you will use to call the 256 colors.
■ Exchange your "case 8: /* Backspace */" statement with mine.
case 8: /* Backspace */
if (cp) {
if (s[cp-2]==3) {
if ((s[cp-1]=='N') || (s[cp-1]=='R') || (s[cp-1]=='S') ||
(s[cp-1]=='B') || (s[cp-1]=='E') || (s[cp-1]=='F') ||
(s[cp-1]=='P') || (s[cp-1]=='D') || (s[cp-1]=='T') ||
(s[cp-1]=='#') || (s[cp-1]=='@'))
backspace();
cp-=2;
ansic(0);
} else
if (s[cp-3]==19) {
cp-=3;
ansic(0);
} else
if (s[cp-1]==8) {
cp--;
outchr(32);
} else {
cp--;
backspace();
}
}
break;
■ and then exchange your "case 23: /* Ctrl-W */" statement with mine.
case 23: /* Ctrl-W */
if (cp) {
do {
if (s[cp-2]==3) {
if ((s[cp-1]=='N') || (s[cp-1]=='R') || (s[cp-1]=='S') ||
(s[cp-1]=='B') || (s[cp-1]=='E') || (s[cp-1]=='F') ||
(s[cp-1]=='P') || (s[cp-1]=='D') || (s[cp-1]=='T') ||
(s[cp-1]=='#') || (s[cp-1]=='@'))
cp-=2;
ansic(0);
} else
if (s[cp-3]==19) {
cp-=3;
ansic(0);
} else
if (s[cp-1]==8) {
cp--;
outchr(32);
} else {
cp--;
backspace();
}
} while ((cp) && (s[cp-1]!=32) && (s[cp-1]!=8));
}
break;
■ and then exchange your "case 16: /* Ctrl-P */" statement with mine.
case 16: /* Ctrl-P */
if (cp<maxlen-1) {
ch=getkey();
if (((ch>='0') && (ch<='7')) || (ch=='n') || (ch=='r') ||
(ch=='s') || (ch=='b') || (ch=='e') || (ch=='f') ||
(ch=='p') || (ch=='d') || (ch=='t') || (ch=='N') ||
(ch=='R') || (ch=='S') || (ch=='B') || (ch=='E') ||
(ch=='F') || (ch=='P') || (ch=='D') || (ch=='T') ||
(ch=='#') || (ch=='@')) {
s[cp++]=3;
s[cp++]=upcase(ch);
if ((ch >='0') && (ch<='7')) ansic(ch-'0');
if ((ch=='N') || (ch=='n')) {
i = curatr;
setc(139);
outstr("Name");
setc(i);
}
if ((ch=='R') || (ch=='r')) {
i = curatr;
setc(139);
outstr("Real Name");
setc(i);
}
if ((ch=='S') || (ch=='s')) {
i = curatr;
setc(139);
outstr("Street");
setc(i);
}
if ((ch=='B') || (ch=='b')) {
i = curatr;
setc(139);
outstr("City");
setc(i);
}
if ((ch=='E') || (ch=='e')) {
i = curatr;
setc(139);
outstr("State");
setc(i);
}
if ((ch=='F') || (ch=='f')) {
i = curatr;
setc(139);
outstr("Zipcode");
setc(i);
}
if ((ch=='P') || (ch=='p')) {
i = curatr;
setc(139);
outstr("DataPhone");
setc(i);
}
if ((ch=='D') || (ch=='d')) {
i = curatr;
setc(139);
outstr("Date");
setc(i);
}
if ((ch=='T') || (ch=='t')) {
i = curatr;
setc(139);
outstr("Time");
setc(i);
}
if ((ch =='#')) {
i = curatr;
setc(139);
outstr("VoicePhone");
setc(i);
}
if ((ch =='@')) {
i = curatr;
setc(139);
outstr("Password");
setc(i);
}
}
}
break;
■ and then add this whole section "case 28: /* Ctrl-\ */"...after your
case 16: Cntl-P.
case 28: /* Ctrl-\ */
if (cp<maxlen-1) {
ch=getkey();
ch2=getkey();
if ((((ch>='0') && (ch<='9')) || ((ch>='A') && (ch<='F')) ||
((ch>='a') && (ch<='f'))) && (((ch2>='0') && (ch2<='9')) ||
((ch2>='A') && (ch2<='F')) || ((ch2>='a') && (ch2<='f')))) {
s[cp++]=19;
if ((ch>='0') && (ch<='9'))
{ i=(ch-48); s[cp++]=ch; }
else if ((ch>='A') && (ch<='F'))
{ i=(ch-55); s[cp++]=ch; }
else if ((ch>='a') && (ch<='f'))
{ i=(ch-87); s[cp++]=(ch-32); }
else break;
if ((ch2>='0') && (ch2<='9'))
{ i1=(ch2-48); s[cp++]=ch2; }
else if ((ch2>='A') && (ch2<='F'))
{ i1=(ch2-55); s[cp++]=ch2; }
else if ((ch2>='a') && (ch2<='f'))
{ i1=(ch2-87); s[cp++]=(ch2-32); }
else break;
if (okansi()) {
i=i*16;
i1=i+i1;
setc(i1);
}
}
}
break;
Save BBSUTL.C!
──╢▌Step 5A▐╟───(optional*)────────────────────────────────────────────────
*-This part will make a list of the codes and their colors
from the BBS mainmenu. Add this where ever you wish.
Another place for it would be in the editor itself.
Sorta like "/HELP" will pop up a help screen make
the color choices in the help screen or a completely
separate command like "/COLOR".
From the main menu in the BBS type "//ANSITEST" to see it!
Now load up BBS.C
find the part labeled...
void mainmenu()
add the following...
= if ((strcmp(s,"UPLOAD")==0) && (actsl>10)) /* existing code */
= upload_post();
+ if (strcmp(s,"ANSITEST")==0) { /* allows 256 color */
+ nl(); /* codes to be viewed */
+ sysoplog("ANSITEST"); /* from Main Menu */
+ for (i=0; i<255; i++) {
+ strcpy(s2,"");
+ sprintf(s2,":%x",i);
+ setc(i);
+ outstr(s2);
+ setc(7);
+ if(((i+1)%16)==0) { setc(0); nl(); }
+ }
+ }
= if (strcmp(s,"QSCAN")==0) { /* existing code */
= nl();
= prt(5,"Clear Q-Scan pointers? ");
= if (yn()) {
Save BBS.C!
──╢▌Step 5B▐╟───(optional*)────────────────────────────────────────────────
From within the Single line editor "/COLOR" to see it!
Now load up MSGBASE.C
find the part labeled "void inmsg(...)"
Search for the following....
= if (s[0]=='/') {
= if (stricmp(s,"/HELP")==0) {
= savel=0;
= printmenu(2);
= }
+ if (stricmp(s,"/COLOR")==0) { /* add this optional section */
+ savel=0; /* of code to show 256 color */
+ for (i=0; i<255; i++) { /* codes from the Single line */
+ strcpy(s2,""); /* editor */
+ sprintf(s2,":%x",i);
+ setc(i);
+ outstr(s2);
+ setc(7);
+ if(((i+1)%16)==0) { setc(0); nl(); }
+ }
+ nl();
+ }
= if (stricmp(s,"/LI")==0) {
= savel=0;
= prt(1,get_string(630));
= i1=yn();
──╢▌Step 6▐╟──(END)────────────────────────────────────────────────────────
Compile the BBS!
The most unique thing about this mod is that you can virtually
Colorize the BBS to your choice of colors, and can hardcode MCI's,
if desired.
Generic Disclaimer! If it melts your system... I'm sorry, You installed
it!
If you have suggestions on improving the mod, fine, I'd like to hear
them. I can be located through any of the listed networks, or [ASV] is
available for High Speed SysOps on my system.
Leisure Larry